﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BusinessManagementStudio.ViewModel.ReportView>" ContentType="text/json" %>
<%@ Import Namespace="System.Globalization" %>

{rows:[<% for (var i = 0; i < Model.QuotationList.Count; i++ ){ %>
    {"id":"<%=Model.QuotationList[i].ID%>", 
        "data":[    
                "<%= Model.QuotationList[i].FM != null ? Model.QuotationList[i].FM : ""%>", 
                "<%= Model.QuotationList[i].Date != null ? Model.QuotationList[i].Date : ""%>",
                "<%= Model.QuotationList[i].QuotationNo != null ? Model.QuotationList[i].QuotationNo : ""%>",
                "<%= Model.QuotationList[i].Location != null ? Model.QuotationList[i].Location : ""%>",
                "<%= Model.QuotationList[i].PDQuotationNo != "" ? Model.QuotationList[i].PDQuotationNo : ""%>",
                "<%= Model.QuotationList[i].QuotationAmountInHKD != 0 ? Model.QuotationList[i].QuotationAmountInHKD.ToString("#,##0.00") : ""%>",
                "<%= Model.QuotationList[i].PDInvoiceNo != "" ? Model.QuotationList[i].PDInvoiceNo : ""%>",
                "<%= Model.QuotationList[i].InvoiceAmountInHKD != 0 ? Model.QuotationList[i].InvoiceAmountInHKD.ToString("#,##0.00") : ""%>",
                "<%= Model.QuotationList[i].InvoicePayment != 0 ? Model.QuotationList[i].InvoicePayment.ToString("#,##0.00") : ""%>",
                "<%= Model.QuotationList[i].PaymentRef != null ? Model.QuotationList[i].PaymentRef : ""%>",
                "<%= Model.QuotationList[i].PaymentDate != null ? Model.QuotationList[i].PaymentDate.Value.ToString("yyyy-MMM-dd", CultureInfo.CreateSpecificCulture("en-US")) : ""%>",
                "<%= Model.QuotationList[i].RefNo != null ? Model.QuotationList[i].RefNo : ""%>",
                "<%= Model.QuotationList[i].CompletedDate != null ? Model.QuotationList[i].CompletedDate.ToString("yyyy-MMM-dd", CultureInfo.CreateSpecificCulture("en-US")) : ""%>",
                "<%= Model.QuotationList[i].InvoiceNo != null ? Model.QuotationList[i].InvoiceNo : ""%>",
                "<%= Model.QuotationList[i].WorkOrderNo != null ? Model.QuotationList[i].WorkOrderNo : ""%>",
                "<%= Model.QuotationList[i].PurchaseOrderNo != null ? Model.QuotationList[i].PurchaseOrderNo : ""%>",
                "<%= Model.QuotationList[i].AmountInHKD != 0 ? Model.QuotationList[i].AmountInHKD.ToString("#,##0.00") : ""%>"
            ]}<%= i < Model.QuotationList.Count ? "," : ""%>               
<% } %>]}
